草庐IT

java - JUnit:同时运行测试

全部标签

javascript - $event.stopPropogation 不是 Angularjs 单元测试中的函数错误

我正在尝试对绑定(bind)到ngClick指令的函数进行单元测试。现在看起来像这样,因为我们刚刚开始这个项目,在我开始之前我想要一些测试覆盖率:vm.open=function($event){$event.preventDefault();$event.stopPropagation();vm.opened=true;};我这样进行单元测试:describe('Unit:simpleSearchController',function(){//includemainmodulebeforeEach(module('myApp'));varctrl,scope,event;//inj

javascript - 单元测试 Angular/ ionic 项目

我有一个非常简单的Controller,看起来像这样。timeInOut.controller('timeInOutController',function($scope,$filter,$ionicScrollDelegate){...});每当我尝试为它创建一个单元测试时......(function(){'usestrict';varscope,controller,filter;describe('timeInOutController',function(){beforeEach(module('common.directives.kmDateToday'));beforeE

javascript - Protractor 中多个/并行浏览器的 E2E 测试?

使用Protractor如何设置/添加并行浏览器进行测试。示例:不仅要在chrome上测试,还要在firefox上测试?还有一种简单的移动测试方法吗?说ios8safari还是移动chrome?问题:如何编写exports.config对象以在并行套件测试中支持chrome和firefox?exports.config={multiCapabilities:[{'browserName':'chrome','chromeOptions':{args:['--test-type']}}]}suites:{homePageFooter:'protractor/homePage/footer

javascript - 如何跳过测试 Nightwatch.js?

我目前使用nightwatch.js、mocha.js和selenium网络驱动程序进行验收测试。我需要跳过一些测试,我该怎么做?module.exports={"UserlogsintheWebPortal":function(browser){browser.url(urlAdress).setValue('input#login',user.login).setValue('input#password',user.password).click('button.ui-button').waitForElementPresent('a[href="/logout"]',middl

javascript - 在javascript setTimeout中将字符串作为函数运行?

为什么这段代码有效?setTimeout("document.body.innerHTML='TEST'",1000)不应该吗?setTimeout(function(){document.body.innerHTML='TEST'},1000)setTimeout如何将字符串转为函数? 最佳答案 引用MDN的setTimeoutdocumentationcodeinthealternatesyntaxisastringofcodeyouwanttoexecuteafterdelaymilliseconds(usingthissyn

javascript - 错误 : Cannot find module 'wrench' , 当我运行 gulp 命令时出现此错误

我已经在本地和全局安装了npm、bower和gulp。当我在该文件夹中运行gulp时,仍然出现此错误。Error:Cannotfindmodule'wrench'atFunction.Module._resolveFilename(module.js:325:15)atFunction.Module._load(module.js:276:25)atModule.require(module.js:353:17)atrequire(internal/module.js:12:17)atObject.(/home/myPC/documents/workspace/frontend/gul

javascript - 如何在 gulp 任务中仅排除 .min.js 文件,同时保持在同一目录中?

虽然我遇到了一个问题,它一遍又一遍地循环处理文件,但我正在尝试为我的前端工作设置一个构建系统。这是我的js处理的问题,因为我不确定如何仅排除以.min作为后缀的文件。任务如下returngulp.src(["!dev/js/*.min.js","dev/js/*.js"]).pipe(plumber()).pipe(browserify()).pipe(smaps.init()).pipe(uglyify({preserveComments:"license"})).pipe(smaps.write()).pipe(rename({suffix:".min"})).pipe(gulp.

javascript - Jest Enzyme 如何对包装组件的存在进行浅层测试

我正在测试一个有条件地呈现包装组件的组件。我正在使用enzyme和jest,根组件是通过shallow()方法呈现的。问题是测试Root组件是否包含包装组件。如何在不使用mount()渲染方法的情况下测试包装组件是否存在?hoc.component.jsxexportfunctionHOC(Component){render(){return}}wrapped.component.jsxclassWrappedComponentextendsReact.Component{...}exportdefaultHOC(WrappedComponent)root.component.jsxc

java - Richfaces 列过滤器 : How to fire an event on intro key

我有一个rich:extendedDataTable并且我正在使用列过滤。我希望在用户输入“intro”键后触发过滤器,但在javascript中没有这样的事件。我想这样做是因为如果我使用诸如onkeyup之类的事件,我会收到太多请求,因此会遇到问题。我正在使用richfaces3.3.0GA和facelets。这是组件: 最佳答案 不幸的是,没有简单的方法来自定义此功能。不过,有一些选项可以使其更有用:-将其放入您的或和你的onkeyup请求将被延迟和分组。参见richfacesdemopage:SettingignoreDupR

javax 脚本如何从 Java 调用 JavaScript 中的函数

我正在尝试通过Java调用JavaScript中的函数。这在直接将脚本作为字符串读取时效果很好,但我使用的是CompiledScripts。当我使用编译脚本执行此操作时,如果我还添加绑定(bind),它会提示找不到方法。没有绑定(bind)它可以工作,但当然函数失败,因为它需要绑定(bind)。有什么想法吗?CompiledScriptscript=...getscript....Bindingsbindings=script.getEngine().createBindings();LoggerscriptLogger=LogManager.getLogger("TEST_SCRIP